define([
        'zepto',
        'backbone',
        'underscore',
        'view/appView',
        'view/newView',
        'view/newTypeView',
        'view/travelsView'
    ],
    function($, Backbone, _, AppView, NewDetailView, NewTypeView, TravelsView){
        var Router = Backbone.Router.extend({
            initialize: function(){
                this.appView = new AppView;
                Backbone.history.start();
            },
            routes: {
                '': 'home', //首页
                'new/:tid/:nid': 'newDetail', //新闻详情
                'newtype/:tid': 'newsList', //区域新闻列表
                'travels': 'travels' //游记列表
            },

            'home': function(){
                this.appView.render();
            },

            newDetail: function (tid, nid) {
                new NewDetailView({
                    tid: tid,
                    nid: nid
                }).render();
            },

            newsList: function (tid) {
                new NewTypeView({
                    tid: tid
                }).render();
            },

            travels: function () {
                new TravelsView().render();
            }

        });
        return Router;
    });
